package com.zbkj.crmeb.block.controller;

import com.common.CommonPage;
import com.common.CommonResult;
import com.common.PageParamRequest;
import com.zbkj.crmeb.block.model.Increment;
import com.zbkj.crmeb.block.request.IncrementSearchRequest;
import com.zbkj.crmeb.block.service.BlockService;
import com.zbkj.crmeb.category.model.Category;
import com.zbkj.crmeb.category.request.CategorySearchRequest;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping("api/admin/block")
@Api(tags = "区块链服务")
public class BlockController {
    @Autowired
    private BlockService blockService;

    @ApiOperation(value = "分页列表")
    @RequestMapping(value = "/increment/list", method = RequestMethod.GET)
    public CommonResult<CommonPage<Increment>> getList(@ModelAttribute IncrementSearchRequest request, @ModelAttribute PageParamRequest pageParamRequest){
        CommonPage<Increment> categoryCommonPage = CommonPage.restPage(blockService.getList(request, pageParamRequest));
        return CommonResult.success(categoryCommonPage);
    }
}
